﻿namespace IOP.OpenType
{
    /// <summary>
    /// uint16 that describes a quantity in font design units.
    /// </summary>
    public struct UFWORD
    {
        private readonly ushort origin;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="number"></param>
        public UFWORD(ushort number) => origin = number;
        /// <summary>
        /// 隐式转换
        /// </summary>
        /// <param name="fWORD"></param>
        public static implicit operator ushort(UFWORD fWORD) => fWORD.origin;
        /// <summary>
        /// 隐式转换
        /// </summary>
        /// <param name="number"></param>
        public static implicit operator UFWORD(short number) => new UFWORD((ushort)number);
        /// <summary>
        /// 隐式转换
        /// </summary>
        /// <param name="number"></param>
        public static implicit operator UFWORD(ushort number) => new UFWORD(number);
    }
}
